package com.atguigu.clients;

import com.atguigu.param.ProductCollectParam;
import com.atguigu.param.ProductIdParam;
import com.atguigu.param.ProductSaveParam;
import com.atguigu.pojo.Product;
import com.atguigu.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * ClassName:ProductClient
 * Package:com.atguigu.clients
 * Description:
 *
 * @Author 应永豪
 * @Create 2024/4/22 9:15
 * @Version 1.0
 */
@FeignClient(value = "product-service")
public interface ProductClient {
    @GetMapping("/product/list")
    List<Product> allList();

    @PostMapping("/product/collect/list")
    R productIds(@RequestBody ProductCollectParam param);

    @PostMapping("/product/cart/detail")
    Product productDetail(@RequestBody ProductIdParam param);

    @PostMapping("/product/cart/list")
    List<Product> cartList(@RequestBody ProductCollectParam param);

    @PostMapping("/product/admin/count")
    Long adminCount(@RequestBody Integer categoryId);

    @PostMapping("/product/admin/save")
    R adminSave(@RequestBody ProductSaveParam param);


}
